package io.codegeneratetool.web.controllers;

import io.codegeneratetool.web.service.DBConnectionService;

import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("")
public class IndexController {

	@Autowired
	private DBConnectionService dbConnectionService;
	
	@RequestMapping("index")
	public void index(HttpServletRequest request,Model view){ 
		
		
	}
	
	
	@ResponseBody
	@RequestMapping("demo")
	public HashMap<String, ?> demo(){
		HashMap<String , ?> map = new HashMap<String, Object>();
		return map;
	}
	
	/** 捕获异常  
	 * @param exception
	 * @return
	 */
	@ExceptionHandler(Exception.class)
	@ResponseBody
	public void handleMyException(Exception exception) {
		exception.printStackTrace();
		 
		 
	}
}
